<div class="p-3">
    <!-- 基础信息 -->
    <div class="mb-4">
        <h6 class="border-bottom pb-2 mb-3">申请信息</h6>
        <div class="row">
            <div class="col-6">
                <p class="mb-2"><span class="text-muted">申请ID：</span><strong>#{{ $formattedApplication['id'] }}</strong></p>
                <p class="mb-2"><span class="text-muted">门店ID：</span>{{ $formattedApplication['store_id'] }}</p>
                <p class="mb-2"><span class="text-muted">申请状态：</span><span class="badge {{ $formattedApplication['status_class'] }}">{{ $formattedApplication['status_label'] }}</span></p>
                <p class="mb-0"><span class="text-muted">提交时间：</span>{{ $formattedApplication['submitted_at'] }}</p>
            </div>
            <div class="col-6">
                <p class="mb-2"><span class="text-muted">审核时间：</span>{{ $formattedApplication['reviewed_at'] }}</p>
                <p class="mb-2"><span class="text-muted">审核人：</span>{{ $formattedApplication['reviewer_name'] ?? '-' }}</p>
                <p class="mb-2"><span class="text-muted">创建时间：</span>{{ $formattedApplication['created_at'] }}</p>
                <p class="mb-0"><span class="text-muted">更新时间：</span>{{ $formattedApplication['updated_at'] }}</p>
            </div>
        </div>
    </div>

    <!-- 门店信息 -->
    <div class="mb-4">
        <h6 class="border-bottom pb-2 mb-3">门店信息</h6>
        <div class="row">
            <div class="col-6">
                <p class="mb-2"><span class="text-muted">门店名称：</span><strong>{{ $formattedApplication['store_name'] }}</strong></p>
                <p class="mb-2"><span class="text-muted">联系人：</span>{{ $formattedApplication['store_contact'] }}</p>
                <p class="mb-0"><span class="text-muted">联系电话：</span>{{ $formattedApplication['store_phone'] }}</p>
            </div>
            <div class="col-6">
                <p class="mb-2"><span class="text-muted">门店地址：</span>{{ $formattedApplication['store_address'] }}</p>
                <p class="mb-0">
                    <span class="text-muted">营业执照：</span>
                    @if($formattedApplication['business_license'] && $formattedApplication['business_license'] != '未提供')
                        <div class="mt-2">
                            <img src="{{ $formattedApplication['business_license'] }}" 
                                 alt="营业执照" 
                                 class="img-fluid rounded border" 
                                 style="max-width: 200px; max-height: 150px; cursor: pointer;"
                                 onclick="showImageModal('{{ $formattedApplication['business_license'] }}', '营业执照')"
                                 title="点击查看大图">
                        </div>
                    @else
                        <span class="text-muted">未提供</span>
                    @endif
                </p>
            </div>
        </div>
    </div>

    <!-- 审核信息 -->
    @if($formattedApplication['status'] == 'rejected')
    <div class="mb-0">
        <h6 class="border-bottom pb-2 mb-3">审核信息</h6>
        <p class="mb-2">
            <span class="text-muted">审核结果：</span>
            <span class="badge {{ $formattedApplication['status_class'] }}">{{ $formattedApplication['status_label'] }}</span>
        </p>
        @if($formattedApplication['reason'])
        <p class="mb-2">
            <span class="text-muted">{{ $formattedApplication['status'] == 'approved' ? '通过原因：' : '拒绝原因：' }}</span>
        </p>
        <div class="bg-light p-3 rounded mb-2">
            {{ $formattedApplication['reason'] }}
        </div>
        @endif
        <p class="mb-0">
            <span class="text-muted">审核时间：</span>{{ $formattedApplication['reviewed_at'] }}
        </p>
    </div>
    @endif
</div>

<!-- 图片查看模态框 -->
<div class="modal fade" id="imageModal" tabindex="-1" role="dialog" aria-labelledby="imageModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="imageModalLabel">
                    <i class="fa fa-image"></i> 图片查看
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center">
                <img id="modalImage" src="" alt="" class="img-fluid">
            </div>
        </div>
    </div>
</div>

<script>
function showImageModal(imageSrc, title) {
    $('#imageModalLabel').html('<i class="fa fa-image"></i> ' + title);
    $('#modalImage').attr('src', imageSrc).attr('alt', title);
    $('#imageModal').modal('show');
}
</script>

<style>
.badge {
    font-size: 11px;
    padding: 4px 8px;
}

h6 {
    font-weight: 600;
    color: #495057;
}

.text-muted {
    font-size: 14px;
}

p {
    font-size: 14px;
    line-height: 1.5;
}
</style>